﻿using UnityEngine;
using System.Collections;

namespace AutoRoot
{
   public class Play : ButtonStateHandler
   {
      void Update()
      {
         GameObject.Find("Progressbar").SendMessage("updateByTime", Global.currentAudio.time, SendMessageOptions.DontRequireReceiver);
      }

      public override void Execute()
      {
         Global.currentAudio.Play();

         GameObject.Find("ButtonPlayOrPause").SendMessage("OnNewState", SendMessageOptions.DontRequireReceiver);
      }
   }
}
